Skip to content

fix(mcpx): reject invalid /v1/interactions score bounds with 400 (#2223) - #3081

Merged
dezren39 merged 1 commit into
mainfrom
queue/4284-2223-score-bounds
Oct 31, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/4284-2223-score-bounds

Conversation

@dezren39

@dezren39 dezren39 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Fixes #2223 · queue task 4284

Problem

GET /v1/interactions silently dropped invalid score bounds:

  • non-numeric / out-of-range minScore/maxScore → parse error swallowed → 200 with the unfiltered list
  • NaN/Inf → ParseFloat succeeds → bound reached SQLite as NULL → 200 with an empty list

Both directions look like real answers on the feedback-review surface.

Change (pkgs/mcpx/internal/daemon/routes_feedback.go)

  • Score bounds: parse error or non-finite value → 400 naming the parameter (invalid minScore "abc": must be a finite number). Finite bounds behave exactly as before.
  • limit/offset in the same handler had the same silent-drop shape → same 400 rule (triage pin from task 3372; store-neutralized today, so this is consistency, not a behavior change for valid input).

Tests (routes_feedback_test.go, real FeedbackStore seeded 0.2/0.5/0.9)

  • abc, NaN, Inf, +Inf, -Inf, 1e999 on both bounds → 400 naming the parameter
  • limit=abc, offset=1.5 → 400
  • Finite control: no filter → 3 rows; minScore=0.4 → 2; maxScore=0.4 → 1; band → 1; limit/offset paging unchanged

Laptop verification: go test ./internal/daemon/ -run TestInteractionsList pass; go test ./internal/logstore/ pass; gofmt clean. Full verification is CI on this PR.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

A non-numeric minScore/maxScore was silently dropped (200, unfiltered list); NaN/Inf parsed successfully and reached SQLite as NULL (200, empty list). Both read as real answers on the feedback-review surface. The handler now 400s naming the parameter on a parse error or non-finite value; finite bounds are unchanged. The same silent-drop shape in limit/offset gets the same 400 rule (triage pin, task 3372). Handler tests cover abc/NaN/Inf/+Inf/-Inf/1e999 on both bounds, bad limit/offset, and the finite control cases.
@dezren39
dezren39 requested a review from a team as a code owner October 31, 2026 13:56
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e45c7c23-a711-4275-aa77-cfca159cd915
Commits

Reviewing files that changed from the base of the PR and between 0fac62c and e580465.

Files selected for processing: 2
  • pkgs/mcpx/internal/daemon/routes_feedback.go
  • pkgs/mcpx/internal/daemon/routes_feedback_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T13:57:54.480611Z e580465 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcpx(daemon): /v1/interactions score filters silently misbehave — a non-numeric minScore returns the unfiltered list, NaN/Inf return an empty one

1 participant